﻿#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

typedef double Real;



typedef struct
{
	int n;
}Context;
Context context = { 0 };

void read_data(Context* ctx)
{
	scanf("%d", &ctx->n);
}

void solve(Context* ctx)
{
	int m = sqrt(ctx->n / 2) + 1;
	int k;
	int i2 = 1;
	int c = 0;
	for (int i = 1; i < m && i2 < ctx->n; ++i, i2 = i * i)
	{
		k = sqrt(ctx->n - i2);
		if (k < i)
			break;
		if (i2 + k * k == ctx->n) {
			printf("%d %d\n", i, k);
			++c;
		}
	}
	if (c == 0)
		printf("No Solution\n");
}

int main()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-176.txt", "r", stdin);
	read_data(&context);
	solve(&context);
	return 0;
}
